package men.adg666.momo;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;

public class EndActivity extends AppCompatActivity {
    private Button returnChooseMode;
    private TextView questionNumberTV;
    private TextView wrongNumberTV;
    private TextView correctNumberTV;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_end);
        returnChooseMode = findViewById(R.id.returnChooseMode);
        questionNumberTV =  findViewById(R.id.questionNumber);
        wrongNumberTV = findViewById(R.id.wrongNumber);
        correctNumberTV =  findViewById(R.id.correctNumber);
        Intent intent = getIntent();
        String correctNumber = String.valueOf(intent.getIntExtra("correctNumber",0));
        String wrongNumber = String.valueOf(intent.getIntExtra("wrongNumber",0));
        String questionNumber = String.valueOf(intent.getIntExtra("questionNumber",0));
        correctNumberTV.setText("答对"+correctNumber+"题");
        wrongNumberTV.setText("答错"+correctNumber+"题");
        questionNumberTV.setText("一共"+questionNumber+"题");
        returnChooseMode.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(EndActivity.this,ModeChoose.class));
                finish();
            }
        });
    }
}
